{include file='_header'}
<div class="page-header">
    当前位置：<span class="text-primary">{if !empty($item['id'])}编辑{else}添加{/if}商品分类 <small>{if !empty($item['id'])}修改【{$item['name']}】{/if}</small></span>
</div>
<div class="page-content">
    <div class="page-sub-toolbar">
        <span class=''>
            <a class="btn btn-primary btn-sm" href="{php echo webUrl('treasure/category/add')}">添加新商品分类</a>
        </span>
    </div>
    <form action="" method="post" class="form-horizontal form-validate" enctype="multipart/form-data" > 
        <div class="form-group">
            <label class="col-lg control-label">排序</label>
            <div class="col-sm-9 col-xs-12">
                <input type="text" name="displayorder" class="form-control" value="{$item['displayorder']}" />
            </div>
        </div>
        <div class="form-group">
            <label class="col-lg control-label must">分类名称</label>
            <div class="col-sm-9 col-xs-12">
                <input type="text" name="catename" class="form-control" value="{$item['name']}" data-rule-required="true" />
            </div>
        </div>
        <div class="form-group">
            <label class="col-lg control-label">分类图片</label>
            <div class="col-sm-9 col-xs-12">
                {:tpl_form_field_image2('thumb', $item['thumb'])}
                <span class="help-block">建议尺寸: 100*100，或正方型图片 </span>
            </div>
        </div>
        <div class="form-group">
            <label class="col-lg control-label">是否首页推荐</label>
            <div class="col-sm-9 col-xs-12">
                <label class="radio-inline">
                    <input type="radio" name='isrecommand' value="1" {if $item['isrecommand']==1}checked{/if} /> 是
                </label>
                <label class="radio-inline">
                    <input type="radio" name='isrecommand' value="0" {if empty($item['isrecommand'])}checked{/if} /> 否
                </label>
            </div>
        </div>
        
        <div class="form-group">
            <label class="col-lg control-label">是否显示</label>
            <div class="col-sm-9 col-xs-12">
                <label class='radio-inline'>
                    <input type='radio' name='enabled' value=1' {if $item['enabled']==1}checked{/if} /> 是
                </label>
                <label class='radio-inline'>
                    <input type='radio' name='enabled' value=0' {if $item['enabled']==0}checked{/if} /> 否
                </label>
            </div>
        </div>
        <div class="form-group"></div>
        <div class="form-group">
            <label class="col-lg control-label"></label>
            <div class="col-sm-9 col-xs-12">
                <input type="submit" value="提交" class="btn btn-primary"  />
               <input type="button" name="back" onclick='history.back()' style='margin-left:10px;' value="返回列表" class="btn btn-default" />
            </div>
        </div>
    </form>
</div>
{include file='_footer'}